<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2020年6月6日</title>
</head>
<style>
    .tip {
        font-size: 12px;
        color: gray;
    }

    #showAnswerBtn {
        display: inline-block;
        background-color: darkgreen;
        color: #fff;
        padding: 10px;
        border-radius: 5px;
    }

    #answer {
        display: none;
    }
</style>

<body>
    变量a是一个64位有符号的整数，初始值用16进制表示为：0x7FFFFFFFFFFFFFFF;变量b是一个64位有符号的整数，初始值用16进制表示为：0x8000000000000000。则a+b的结果用10进制表示为多少？
    <br>
    A. 1
    <br>
    B. -1
    <br>
    C. 2^63+2^62+…+2^2+2^1+2^0
    <br>
    D. –(2^63+2^62+…+2^2+2^1+2^0)

    <div>
        <span id="showAnswerBtn">点击查看正确答案</span>
    </div>
    <div id="answer">
        <p>答案：B</p>
        0x7FFFFFFFFFFFFFFF + 0x8000000000000000 = 0xFFFFFFFFFFFFFFFF 转为源码 = -1
    </div>
    <p class="tip">
        来源：<a
            href="https://www.nowcoder.com/test/question/done?tid=33883576&qid=55201#summary">https://www.nowcoder.com/test/question/done?tid=33883576&qid=55201#summary</a>
    </p>
    <script>
        document.getElementById("showAnswerBtn").onclick = function () {
            document.getElementById("answer").style.display = "block";
            document.getElementById("showAnswerBtn").style.display = "none";
        }
    </script>
</body>

</html>